#ifndef KPORTBENCH_H
#define KPORTBENCH_H

#include <QMainWindow>
#include <QTimer>
#include <QCloseEvent>
#include <QTime>
#include "worker.h"
#include "curve.h"
#include <mgl/mgl_qt.h>
#include <mgl/mgl.h>

namespace Ui {
    class kportBench;
}

class kportBench : public QMainWindow {
    Q_OBJECT
public:
    kportBench(QWidget *parent = 0);
    ~kportBench();

protected:
    void changeEvent(QEvent *e);
    void closeEvent(QCloseEvent *);

private slots:
    void updateGraph();
private:
    int sample;
    float *x;
    float *y;
    float *yInt;

    Curve *c;
    QMathGL *qmgl;

    Ui::kportBench *ui;
    uint lastread;
    QTime lasttime;
    QTimer timer;
    worker w;
};

#endif // KPORTBENCH_H
